package prototype;

import prototype.actors.framework.Manager;
import prototype.actors.MessageBox;
import prototype.actors.framework.Product;
import prototype.actors.UnderlinePen;

/**
 * @author chj
 * 类名：Main
 * 类型：具体类
 * 类含义：表示测试程序行为的对象
 * 设计模式角色：无
 */
public class Main {
    public static void main(String[] args){
        //准备
        Manager manager = new Manager();
        MessageBox messageBox1 = new MessageBox('*');
        MessageBox messageBox2 = new MessageBox('/');
        UnderlinePen underlinePen = new UnderlinePen('~');
        manager.register("warningBox",messageBox1);
        manager.register("slashBox",messageBox2);
        manager.register("strongPen",underlinePen);
        //生成
        Product p1 = manager.create("warningBox");
        p1.use("HelloWorld");
        Product p2 = manager.create("slashBox");
        p2.use("HelloJava");
        Product p3 = manager.create("strongPen");
        p3.use("HelloSpring");
    }
}
